package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/api/apis"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, studentRouter)
}

func studentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.ApiStudent{}
	v1auth := v1.Group("/student").Use(authMiddleware.MiddlewareFunc()).Use(middleware.CheckLogin)
	{
		v1auth.GET("/info", api.GetUserInfo)
		v1auth.POST("/update", api.UpdateStudent)
		v1auth.POST("/invite/qrcode", api.MyInviteCode)
		v1auth.GET("/invite/list", api.MyInvite)
		v1auth.POST("/study/duration", api.Chronography)
		//余额支付
		v1auth.POST("/pay/balance", api.PayBalance)
		//注销学生账号
		v1auth.POST("/delete", api.DeleteStudent)
		v1auth.POST("uploadBase64", api.UploadBase64)

		//e电签获取个人认证&授权页面链接
		v1auth.POST("psnAuthUrl", api.PsnAuthUrl)
		//e电签基于文件发起签署
		v1auth.POST("createByFile", api.CreateByFile)
		//e电签获取合同文件签署链接
		v1auth.POST(":signFlowId/signUrl", api.SignUrl)
		// 学生端获取下载合同地址
		v1auth.GET(":signFlowId/fileDownloadUrl", api.FileDownloadUrl)
		// 查询个人认证信息
		v1auth.GET("identityInfo/:psnAccount", api.IdentityInfo)

	}
}
